package jroguelike.main;

/**
 * Created by IntelliJ IDEA.
 * User: aimozg
 * Date: 20.07.11
 * Time: 22:25
 */
public class TextUtils {

	public static final String[] healthConditionNames = {
			"almost dead",
			"severly wounded",
			"wounded",
			"lightly wounded",
			"bruised"
	};
	public static String healthCondition(int value,int max){
		if (value<=0) return "dead";
		if (value==max) return "unhurt";
		if (value>max) return "boosted";
		double prop = ((double)value)/max;
		return healthConditionNames[(int)(prop*healthConditionNames.length)];
	}

	public static final String[] durabilityNames = {
			"almost destroyed",
			"severly damaged",
			"damaged",
			"lightly damaged",
			"scratched"
	};
	public static String durability(int value,int max){
		if (value<=0) return "destroyed";
		if (value==max) return "untouched";
		if (value>max) return "overpowered";
		double prop = ((double)value)/max;
		return durabilityNames[(int)(prop*durabilityNames.length)];
	}

	private TextUtils(){}
}
